Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

fix duplicate setter methods#1322

Merged
XiaofeiCao merged 11 commits into
Azure:mainfrom
XiaofeiCao:fix_duplicate_setter_methods
Jan 24, 2022
Merged

fix duplicate setter methods#1322
XiaofeiCao merged 11 commits into
Azure:mainfrom
XiaofeiCao:fix_duplicate_setter_methods

Conversation

@XiaofeiCao

@XiaofeiCao XiaofeiCao commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

fix #1320

@weidongxu-microsoft weidongxu-microsoft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean-up file not related to your change

Comment thread javagen/src/main/java/com/azure/autorest/template/ModelTemplate.java Outdated
Comment thread fluentgen/src/test/java/com/azure/autorest/fluent/DeduplicateSetterTest.java Outdated
Comment thread fluentgen/src/test/java/com/azure/autorest/fluent/TestUtils.java Outdated
@XiaofeiCao
XiaofeiCao marked this pull request as ready for review January 20, 2022 09:12
Comment thread fluentgen/src/test/java/com/azure/autorest/fluent/TestUtils.java Outdated
Assertions.assertEquals(toOverride.size(), 1);
}

private ObjectSchema loadSiteSchemaParent() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why called loadSiteSchemaParent?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just loadSiteSchema?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't look much deep into it, but when I tried to load the child schema Site only, This line of code :

ClientModel parentModel = ClientModels.Instance.getModel(parentModelName);

will get null for parent model, so I choose to load parent schema, which will have this line of code:
run and register the parent model.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to load full code model.

Comment thread javagen/src/main/java/com/azure/autorest/template/ModelTemplate.java Outdated
Comment thread fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java
@XiaofeiCao
XiaofeiCao merged commit 2a378a0 into Azure:main Jan 24, 2022
@XiaofeiCao
XiaofeiCao deleted the fix_duplicate_setter_methods branch January 24, 2022 01:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove duplicate setter methods from child schema when parent schema contains same property

2 participants